# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=kubolt
pkgver=28.0027239
pkgrel=7
pkgdesc='Utility for scanning public kubernetes clusters.'
groups=('blackarch' 'blackarch-webapp' 'blackarch-scanner')
arch=('any')
url='https://github.com/averonesis/kubolt'
license=('GPL3')
depends=('python' 'python-click' 'python-requests' 'python-shodan')
makedepends=('git')
source=("git+https://github.com/averonesis/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i '1i\#!/usr/bin/python3' "$pkgname.py"
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 755 "$pkgname.py" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  rm README.md LICENSE

  cp -a * "$pkgdir/usr/share/$pkgname/"
}

